// EcoModeler - C# Edition :: Version 9.16 build 3301
using System;
using System.ComponentModel;
using System.Collections;
using System.Collections.Generic;
using Eco.Services;
using Eco.ObjectRepresentation;
using Eco.ObjectImplementation;
using Eco.UmlRt;
using Eco.UmlCodeAttributes;
using Eco.Subscription;

namespace TTServer
{
	#region MM_ECO_Generated
	#region Attributes
	[UmlElement(Id="{adc13b83-bf4d-48c0-9c95-796e51ada478}")]
	#endregion

	#region Documentation
	//1 Saison
	/// Saison, in der ein Wettbewerb statt findet
	#endregion

	#endregion
	public class Saison: object, ILoopBack
	{
		#region MM_ECO AutoGenerated ECO code

		protected IContent eco_Content;

		IObject IObjectProvider.AsIObject()
		{
			return this.eco_Content.AsIObject();
		}

		public IObjectInstance AsIObject()
		{
			return this.eco_Content.AsIObject();
		}

		public struct Eco_LoopbackIndices
		{
			public const int Eco_FirstMember = 0;
			public const int Eco_MemberCount = (Eco_FirstMember + 6);
			public const int Halbrunde_MemberIndex = Eco_FirstMember + 0;
			public const int Name_MemberIndex = Eco_FirstMember + 1;
			public const int Pokalbegegnung_MemberIndex = Eco_FirstMember + 2;
			public const int Rahmenterminplan_MemberIndex = Eco_FirstMember + 3;
			public const int Spieldimension_MemberIndex = Eco_FirstMember + 4;
			public const int Startdatum_MemberIndex = Eco_FirstMember + 5;
		}

		public virtual object get_MemberByIndex(int index)
		{
			switch (index)
			{
				default: throw new System.IndexOutOfRangeException();
			}
		}

		public virtual void set_MemberByIndex(int index, object value)
		{
			switch (index)
			{
				default: throw new System.IndexOutOfRangeException();
			}
		}

		protected void Initialize(IEcoServiceProvider serviceProvider)
		{
			if ((this.eco_Content == null))
			{
				IInternalObjectContentFactory factory = ((IInternalObjectContentFactory)(serviceProvider.GetEcoService(typeof(IInternalObjectContentFactory))));
				this.eco_Content = factory.CreateContent(this);
				this.eco_Content.LoopbackValid();
			}
		}

		protected void Deinitialize(IEcoServiceProvider serviceProvider)
		{
			if ((this.eco_Content != null))
			{
				IInternalObjectContentFactory factory = ((IInternalObjectContentFactory)(serviceProvider.GetEcoService(typeof(IInternalObjectContentFactory))));
				factory.CreateContentFailed(this.eco_Content, this);
				this.eco_Content = null;
			}
		}
		#endregion

		#region MM_ECO Model owned attributes
		//Note: Do not remove any property within this region, nor change its signature


		#region MM_ECO_Generated
		#region Attributes
		[UmlElement(Index=(Saison.Eco_LoopbackIndices.Name_MemberIndex), Id="{a7eb7307-00c1-4cd2-a79a-8108d817fe7f}")]
		[UmlTaggedValue("Eco.Length", "255")]
		#endregion

		#region Documentation
		//1 Bezeichnung der Saison
		/// Bezeichnung der Saison:
		/// 
		/// z.B.:
		/// 
		/// 2008/2009
		#endregion

		#endregion
		public string Name
		{
			get
			{
				#region MM_ECO_Generated
				return (string) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Name_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.Name_MemberIndex, ((object)(value)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		#region Attributes
		[UmlElement(Index=(Saison.Eco_LoopbackIndices.Startdatum_MemberIndex), Id="{c661800c-df58-44d0-a668-bf2f397c34a6}")]
		[UmlTaggedValue("Eco.Length", "255")]
		#endregion

		#region Documentation
		//1 Startdatum der Saison
		/// Startdatum der Saison
		#endregion

		#endregion
		public DateTime Startdatum
		{
			get
			{
				#region MM_ECO_Generated
				return (DateTime) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Startdatum_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.Startdatum_MemberIndex, ((object)(value)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Saison.Eco_LoopbackIndices.Halbrunde_MemberIndex), Id="{7f2f6fd6-3972-43f4-9a6f-35f28c079d06}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.HalbrundeSaison), Index=0)]
		[UmlMetaAttribute("multiplicity", "0..*")]
		[UmlTaggedValue("Eco.Embed", "False")]
		#endregion
		public IEcoList<Halbrunde> Halbrunde
		{
			get
			{
				#region MM_ECO_Generated
				return new ObjectListAdapter<Halbrunde>((IList) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Halbrunde_MemberIndex)));
				#endregion
			}
		}


		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Saison.Eco_LoopbackIndices.Rahmenterminplan_MemberIndex), Id="{ca61d7d1-5268-4068-8712-ee4a0042eef8}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.SaisonRahmenterminplan), Index=1)]
		[UmlMetaAttribute("multiplicity", "0..*")]
		[UmlTaggedValue("Eco.Embed", "False")]
		#endregion
		public IEcoList<Rahmenterminplan> Rahmenterminplan
		{
			get
			{
				#region MM_ECO_Generated
				return new ObjectListAdapter<Rahmenterminplan>((IList) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Rahmenterminplan_MemberIndex)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Saison.Eco_LoopbackIndices.Pokalbegegnung_MemberIndex), Id="{f5a34b51-dc85-46e1-aca1-5bf052365500}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.PokalbegegnungSaison), Index=0)]
		[UmlMetaAttribute("multiplicity", "0..*")]
		[UmlTaggedValue("Eco.Embed", "False")]
		#endregion
		public IEcoList<Pokalbegegnung> Pokalbegegnung
		{
			get
			{
				#region MM_ECO_Generated
				return new ObjectListAdapter<Pokalbegegnung>((IList) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Pokalbegegnung_MemberIndex)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Saison.Eco_LoopbackIndices.Spieldimension_MemberIndex), Id="{736e21fc-edb6-4797-97e2-b0d234099a9c}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.SaisonSpieldimension), Index=1)]
		[UmlMetaAttribute("multiplicity", "0..*")]
		[UmlTaggedValue("Eco.Embed", "False")]
		#endregion
		public IEcoList<Spieldimension> Spieldimension
		{
			get
			{
				#region MM_ECO_Generated
				return new ObjectListAdapter<Spieldimension>((IList) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Spieldimension_MemberIndex)));
				#endregion
			}
		}
		#endregion

		#region MM_ECO Model owned methods
		//Note: Do not remove any method within this region, nor change its signature

		public Saison(IContent content)
		{
			#region MM_ECO_Generated
			this.eco_Content = content;
			content.AssertLoopbackUnassigned();
			#endregion
		}

		public Saison(IEcoServiceProvider serviceProvider)
		{
			this.Initialize(serviceProvider);
			try
			{
				// Place user code ONLY here
			}
			catch (System.Exception)
			{
				this.Deinitialize(serviceProvider);
				throw;
			}
		}
		#endregion
	}
}
